package com.gxa.p2p.service.impl;

import com.gxa.p2p.mapper.ParamMapper;
import com.gxa.p2p.pojo.Param;
import com.gxa.p2p.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author R
 * @data 2021-10-28 16:03
 */
@Service
public class ParamServiceImpl implements ParamService {

    @Autowired
    ParamMapper mapper = null;

    @Override
    public List<Param> findAllParam(String name, Integer page, Integer size) {
        List<Param> allParam = mapper.findAllParam(name, (page - 1) * size, size);
        return allParam;
    }

    @Override
    public Integer findAllParamCount(String name, Integer page, Integer size) {
        page = null;
        size = null;
        List<Param> allParam = mapper.findAllParam(name, page, size);
        return allParam.size();
    }

    @Override
    public void deleteParam(Integer id) {
        mapper.deleteParam(id);
    }
}
